<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <img :src="publicUrls + 'free/style9/firstLevelStyle1BackShadow.png?imageView2/3/format/webp'" alt="" class="bg-shadow" />
    <!-- <img :src="publicUrls + 'free/style9/firstLevelStyle1Bg.png'" alt="" > -->
    <div
      class="outline-parent-bg"
      :class="{ 'outline-parent-bg2': !props.info.subTitle && !props.info.value }"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style9/firstLevelStyle1Bg.png?imageView2/format/webp'})`,
      }"
    >
      <div class="mask-box">
        <img :src="publicUrls + 'free/style9/firstLevelStyle1Mask.png'" alt="" />
      </div>
      <!-- <div class="bg-top-box">
        <img :src="publicUrls + 'free/style9/firstLevelStyle1BgTop.png'" alt="" class="empty-img" />
      </div> -->
      <div class="showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div
        class="title-box"
        :class="{ 'null-sub-img2': !props.info.value && !props.info.subTitle }"
        v-if="props.info.text"
      >
        <img :src="publicUrls + 'free/style9/titleTopIcon.png?imageView2/3/format/webp'" alt="" class="title-icon" />
        <div class="title">{{ props.info.text }}</div>
        <img :src="publicUrls + 'free/style9/titleBottomIcon.png?imageView2/3/format/webp'" alt="" class="title-icon" />
      </div>
      <p class="sub-title" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
      <div class="line" v-if="props.info.subTitle"></div>
      <div
        class="unit-img-box"
        :class="{ 'unit-img-box2': !props.info.subTitle && !props.info.remarks }"
        v-if="props.info.value"
      >
        <img
          @click="ImgVisible = true"
          :src="urls + props.info.value + '?imageView2/3/format/webp'"
          alt=""
          class="unit-img"
        />
      </div>
      <div class="remarks1" v-if="props.info.value">
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="6"
        ></TextMax>
      </div>
      <div
        class="remarks2"
        :class="{ 'null-sub-img': !props.info.value && !props.info.subTitle }"
        v-else-if="props.info.remarks"
      >
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="props.info.subTitle ? 14 : props.info.value ? 6 : 14"
        />
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free9Style1',
});
</script>
<script lang="ts" setup>
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style9.vue';
import TextMax from '@/freeComponents/textMode/TextMax9.vue';
import { getRemarksNum } from '@/utils/minxin';
import { publicUrls, textType } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
import { transform } from 'lodash';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();
const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style lang="less" scoped>
.outline-parent {
  position: relative;
  // margin-top: 0;
  margin-right: 160px;
}
.showroom-parent {
  position: absolute;
  top: 16px;
  right: 14px;
  z-index: 21;
  width: 40px;
  height: 40px;
}
.bg-shadow {
  position: absolute;
  bottom: 0;
  left: 10px;
  z-index: 10;
  width: 770px;
  height: 230px;
}
.outline-parent-bg {
  position: relative;
  z-index: 20;
  width: 602px;
  height: 100%;
  display: flex;
  flex-direction: column;
  // justify-content: center;
  align-items: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding-bottom: 70px;
  padding-top: 90px;
}
.outline-parent-bg2 {
  padding-bottom: 100px;
  // .null-sub-img {
  //   margin-top: 100px;
  // }
}
.mask-box {
  width: 590px;
  height: 717px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  pointer-events: none;
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
.bg-top-box {
  width: 296px;
  height: 76px;
  flex-shrink: 0;
}
.empty-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.title-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
  margin-top: 20px;
}
.null-sub-img2 {
  // margin-bottom: 80px;
}
.title-icon {
  width: 400px;
  height: 10px;
  flex-shrink: 0;
}
.title {
  width: 350px;
  flex-shrink: 0;
  text-align: center;
  color: #8a7a6a;
  text-shadow: 1.2px 1.2px 0px #d5c8b2;
  font-family: 'SourceHanSerifCN';
  font-size: 32px;
  font-style: normal;
  font-weight: 700;
  line-height: 48px; /* 150% */
  // background: radial-gradient(83.14% 109.9% at 49.25% -9.9%, #b1987f 0%, #8a7a6a 100%);
  // background-clip: text;
  // -webkit-background-clip: text;
  // -webkit-text-fill-color: transparent;
}
.sub-title {
  flex-shrink: 0;
  width: 380px;
  color: #8a7a6a;
  text-align: center;
  /* 一级副标 */
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px; /* 155.556% */
  margin-top: 20px;
}
.line {
  flex-shrink: 0;
  width: 400px;
  height: 1px;
  background: #8a7a6a;
  margin-top: 20px;
}
.unit-img-box2 {
  height: 538px !important;
  clip-path: polygon(4% 0, 96% 0, 100% 4%, 100% 96%, 96% 100%, 4% 100%, 0 96%, 0 4%) !important;
  .unit-img {
    clip-path: polygon(3.8% 0, 96.2% 0, 100% 3.8%, 100% 96.2%, 96.2% 100%, 3.8% 100%, 0 96.2%, 0 3.8%) !important;
  }
}
.unit-img-box {
  flex-shrink: 0;
  width: 430px;
  height: 240px;
  margin-top: 20px;
  background: radial-gradient(89.3% 100% at 50% 0%, #b5b0a9 0%, #979189 100%);
  // background-color: #d9d9d9;
  clip-path: polygon(6% 0, 94% 0, 100% 10%, 100% 90%, 94% 100%, 6% 100%, 0 90%, 0 10%);
  padding: 6px;
}
.unit-img {
  width: 100%;
  height: 100%;
  clip-path: polygon(5.3% 0, 94.7% 0, 100% 9%, 100% 91%, 94.7% 100%, 5.3% 100%, 0 91%, 0 9%);
}
.remarks1 {
  flex-shrink: 0;
  width: 410px;
  margin-top: 20px;
}
.remarks2 {
  flex-shrink: 0;
  width: 410px;
  margin-top: 40px;
}
.null-sub-img {
  margin-top: 80px;
}
</style>
